package com.atung.provider;

import java.util.Objects;

import org.apache.ibatis.jdbc.SQL;

import com.atung.model.BusCarRide;

public class BusCarRideProvider {

	
	public String saveBusCarRideProvider(BusCarRide busCarRide){
		
		return new SQL(){
			{
				INSERT_INTO("bus_car_ride");
				VALUES("id", "#{id}");
				VALUES("allocation_id", "#{allocationId}");
				VALUES("order_id", "#{orderId}");
				VALUES("ride_name", "#{rideName}");
				VALUES("ride_phone", "#{ridePhone}");
				if(Objects.nonNull(busCarRide.getIsRide())){
					VALUES("is_ride", "#{isRide}");
				}
				if(Objects.nonNull(busCarRide.getIsDelect())){
					VALUES("is_delect", "#{isDelect}");
				}
				VALUES("creation_time", "#{creationTime}");
				VALUES("modification_time", "#{modificationTime}");
			}
		}.toString();
	}
}
